home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Development Platforms / Apple II / Essentials / APW Interfaces / CInclude / HyperXCMD.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-05-07  |  7.5 KB  |  151 lines  |  [TEXT/MPS ]

  1. /*********************************************************
  2.  
  3.   File: HyperXCMD.h
  4.  
  5.   Definition file for HyperCard XCMDs and XFCNs in C
  6.   For use with HyperCard IIGS Version 1.1
  7.  
  8.   Copyright © Apple Computer, Inc. 1990-92
  9.   All Rights Reserved
  10.  
  11. *********************************************************/
  12.  
  13. #ifndef __TYPES__
  14. #include <TYPES.h>
  15. #endif
  16.  
  17. #ifndef __GSOS__
  18. #include <GSOS.h>    /* for definition of GSString255 */
  19. #endif
  20.  
  21. #ifndef __CONTROL__
  22. #include <CONTROL.h>    /* for definition of WindowPtr */
  23. #endif
  24.  
  25. #ifndef __HYPERXCMD__
  26. #define __HYPERXCMD__
  27.  
  28. #define _CallBackVector     0x00E10220L
  29.  
  30. /* XCMDBlock constants for event.what... */
  31. #define    xOpenEvt              1000         /* the first event after you are created     */
  32. #define    xCloseEvt             1001         /* your window is being forced close         */
  33. #define    xHidePalettesEvt    1004        /* someone called HideHCPalettes             */
  34. #define    xShowPalettesEvt    1005        /* someone called ShowHCPalettes             */
  35. #define    xCursorWithin        1300        /* cursor is within the window                 */
  36.  
  37. /* XWindow styles */
  38. #define    xWindoidStyle        0
  39. #define    xRectStyle            1
  40. #define    xShadowStyle        2
  41. #define    xDialogStyle        3
  42.  
  43. typedef String(19) Str19, *String19Ptr, **String19Handle;
  44. typedef String(31) Str31, *String31Ptr, **String31Handle;
  45.  
  46. struct XCMDBlock    {
  47.     int        paramCount;
  48.     Handle    params[16];
  49.     Handle    returnValue;
  50.     Boolean    passFlag;
  51.     Word    userID;
  52.     Word    returnStat;        /* 0 if normal, 1 if error    */
  53. } ;
  54. typedef struct XCMDBlock XCMDBlock, *XCMDPtr;
  55.  
  56. struct XWEventInfo {
  57.     WindowPtr        eventWindow;
  58.     EventRecord        event;
  59.     long            eventParams[9];
  60.     Handle            eventResult;
  61. };
  62. typedef struct XWEventInfo XWEventInfo, *XWEventInfoPtr; 
  63.  
  64. /****  HyperTalk Utilities  ****/
  65. extern pascal Handle        EvalExpr( /* Str255 expr */ ) inline(0x0002,_CallBackVector);
  66. extern pascal void            SendCardMessage( /* Str255 msg */ ) inline(0x0001,_CallBackVector);
  67. extern pascal void            SendHCMessage( /* Str255 msg */ ) inline(0x0005,_CallBackVector);
  68.  
  69.  
  70. /****  Memory Utilities  ****/
  71. extern pascal Handle        GetGlobal( /* Str255 *globName */ ) inline(0x0012,_CallBackVector);
  72. extern pascal void            SetGlobal( /* Str255 globName,Handle globValue */ ) inline(0x0013,_CallBackVector);
  73. extern pascal void            ZeroBytes( /* Ptr dstPtr,long longCount */ ) inline(0x0006,_CallBackVector);
  74.  
  75.  
  76. /****  String Utilities  ****/
  77. extern pascal Boolean        GSStringEqual( /* GSString255Hndl src1,GSString255Hndl src2 */ ) inline(0x0022,_CallBackVector);
  78. extern pascal void            ScanToReturn( /* Ptr *scanPtr */ ) inline(0x001C,_CallBackVector);
  79. extern pascal void            ScanToZero( /* Ptr *scanPtr */ ) inline(0x001D,_CallBackVector);
  80. extern pascal Boolean        StringEqual( /* Str255 str1,Str255 str2 */ ) inline(0x001A,_CallBackVector);
  81. extern pascal Longint        StringLength( /* Ptr strPtr */ ) inline(0x0003,_CallBackVector);
  82. extern pascal Ptr            StringMatch( /* Str255 stringPattern,Ptr target */ ) inline(0x0004,_CallBackVector);
  83.  
  84.  
  85. /****  String Conversions  ****/
  86. extern pascal Str31            BoolToStr( /* Boolean bool */ ) inline(0x0010,_CallBackVector);
  87. extern pascal GSString255Hndl    CopyGSString( /* GSString255Hndl src */ ) inline(0x0020,_CallBackVector);
  88. extern pascal Str31            ExtToStr( /* Extended extendedNumber */ ) inline(0x0011,_CallBackVector);
  89. extern pascal GSString255Hndl  GSConcat( /* GSString255Hndl src1,GSString255Hndl src2 */ ) inline(0x0021,_CallBackVector);
  90. extern pascal Str255        GSToPString( /* GSString255Hndl src */ ) inline(0x001E,_CallBackVector);
  91. extern pascal Handle        GSToZero( /* GSString255Hndl src */ ) inline(0x0023,_CallBackVector);
  92. extern pascal Str31            LongToStr( /* Longint posNum */ ) inline(0x000D,_CallBackVector);
  93. extern pascal Str19            NumToHex( /* Longint longNumber,word nDigits */ ) inline(0x000F,_CallBackVector);
  94. extern pascal Str31            NumToStr( /* Longint longNumber */ ) inline(0x000E,_CallBackVector);
  95. extern pascal void             PointToStr( /* Point pt, Str255 str */ ) inline(0x002D,_CallBackVector);                        
  96. extern pascal Handle        PasToZero( /* Str255 str */ ) inline(0x0007,_CallBackVector);
  97. extern pascal GSString255Hndl  PToGSString( /* Str255 src */ ) inline(0x001F,_CallBackVector);
  98. extern pascal void             RectToStr( /* Rect *rct, Str255 str */ ) inline(0x002E,_CallBackVector);                        
  99. extern pascal void            ReturnToPas( /* Ptr zeroStr,Str255 *pasStr */ ) inline(0x001B,_CallBackVector);
  100. extern pascal Boolean        StrToBool( /* Str31 str */ ) inline(0x000B,_CallBackVector);
  101. extern pascal extended        StrToExt( /* Str31 str */ ) inline(0x000C,_CallBackVector);
  102. extern pascal Longint        StrToLong( /* Str31 str */ ) inline(0x0009,_CallBackVector);
  103. extern pascal Longint        StrToNum( /* Str31 str */ ) inline(0x000A,_CallBackVector);
  104. extern pascal void             StrToPoint( /* Str255 str, Point pt */ ) inline(0x002F,_CallBackVector);                        
  105. extern pascal void             StrToRect( /* Str255 str, Rect *rct */ ) inline(0x0030,_CallBackVector);                        
  106. extern pascal GSString255Hndl  ZeroToGS( /* Handle src */ ) inline(0x0024,_CallBackVector);
  107. extern pascal void            ZeroToPas( /* Ptr zeroStr,Str255 *pasStr */ ) inline(0x0008,_CallBackVector);
  108.  
  109.  
  110. /****  Field Utilities  ****/
  111. extern pascal Handle        GetFieldByID( /* Boolean cardFieldFlag,word fieldID */ ) inline(0x0016,_CallBackVector);
  112. extern pascal Handle        GetFieldByName( /* Boolean cardFieldFlag,Str255 fieldName */ ) inline(0x0014,_CallBackVector);
  113. extern pascal Handle        GetFieldByNum( /* Boolean cardFieldFlag,word fieldNum */ ) inline(0x0015,_CallBackVector);
  114. extern pascal void            SetFieldByID( /* Boolean cardFieldFlag,word fieldID,Handle fieldVal */ ) inline(0x0019,_CallBackVector);
  115. extern pascal void            SetFieldByName( /* Boolean cardFieldFlag,Str255 fieldNName,Handle fieldVal */ ) inline(0x0017,_CallBackVector);
  116. extern pascal void            SetFieldByNum( /* Boolean cardFieldFlag,word fieldNum,Handle fieldVal */ ) inline(0x0018,_CallBackVector);
  117.  
  118.  
  119. /****  Graphic Utilities  ****/
  120. extern pascal void            ChangedMaskAndData( /* word whatChanged */ ) inline(0x002C,_CallBackVector);
  121. extern pascal void            GetMaskAndData( /* mask *LocInfo, data *LocInfo */ ) inline(0x002B,_CallBackVector);
  122.  
  123.  
  124. /****  Miscellaneous Utilities  ****/
  125. extern pascal void            BeginXSound( ) inline(0x0029,_CallBackVector);
  126. extern pascal void            EndXSound( ) inline(0x002A,_CallBackVector);
  127.  
  128.  
  129. /****  Resource Names Utilities  ****/
  130. extern pascal Boolean        FindNamedResource( /* word resourceType,Str255 resourceName,word *theFile,long *resourceID */ ) inline(0x0026,_CallBackVector);
  131. extern pascal Str255        GetResourceName( /* word resourceType,long resourceID */ ) inline(0x0028,_CallBackVector);
  132. extern pascal Handle        LoadNamedResource( /* word resourceType,Str255 resourceName */ ) inline(0x0025,_CallBackVector);
  133. extern pascal void            SetResourceName( /* word resourceType,long resourceID,Str255 resourceName */ ) inline(0x0027,_CallBackVector);
  134.  
  135.  
  136. /****  Creating and Disposing XWindoids  ****/
  137. extern pascal WindowPtr        NewXWindow( /* Rect boundsRect, Str31 windName, Boolean visible, word windowStyle */ ) inline(0x0031,_CallBackVector);
  138. extern pascal void            CloseXWindow( /* WindowPtr window */ ) inline(0x0033,_CallBackVector);
  139.  
  140.  
  141. /****  XWindoid Utilities  ****/
  142. extern pascal Longint        GetXWindowValue( /* WindowPtr window */ ) inline(0x0037,_CallBackVector);
  143. extern pascal void            HideHCPalettes( ) inline(0x0034,_CallBackVector);
  144. extern pascal void            ShowHCPalettes( ) inline(0x0035,_CallBackVector);
  145. extern pascal void            SetXWIdleTime( /* WindowPtr window, Longint interval */ ) inline(0x0032,_CallBackVector);
  146. extern pascal void            SetXWindowValue( /* WindowPtr window, Longint customValue */ ) inline(0x0036,_CallBackVector);
  147. extern pascal void             XWAllowReEntrancy( /*WindowPtr window, Boolean allowSysEvts, Boolean allowHCEvts */ ) inline(0x0038,_CallBackVector);
  148.  
  149.  
  150. #endif
  151.